<?php

class Setting_accountApp extends BackendApp {

    function __construct() {
        $this->Setting_accountApp();
    }

    function Setting_accountApp() {
        parent::BackendApp();
        $_POST = stripslashes_deep($_POST);
    }

    function index() {
        $model_setting = &af('settings');
        $setting = $model_setting->getAll(); //载入系统设置数据
        if (!IS_POST) {
            $this->assign('setting', $setting);
            $this->display('setting_account.qq.html');
        } else {
            $data['third_login_register'] = $_POST['third_login_register'];#是否开启自动注册
            $data['qq_appid'] = trim($_POST['qq_appid']);
            $data['qq_appkey'] = trim($_POST['qq_appkey']);
            $data['wxlogin_qr_appid'] = trim($_POST['wxlogin_qr_appid']);
            $data['wxlogin_qr_appkey'] = trim($_POST['wxlogin_qr_appkey']);
            $data['sina_appid'] = trim($_POST['sina_appid']);
            $data['sina_appkey'] = trim($_POST['sina_appkey']);
            
            $model_setting->setAll($data);
            $this->admin_log(Lang::get('login_set'), 1);

            $this->show_message('edit_setting_account_successed');
        }
    }
}

?>
